<template>
  <div class="blacklistDetail">
    <div class="left-main white-wrap">
      <span :class="['anchor',curIndex===index?'active':'']" v-for="(item,index) in blocks" @click="jump(index,item)" :key="index">{{item.name}}</span>
    </div>
    <div class="right-main">
      <router-view></router-view>
    </div>
  </div>
</template>
<script>
export default {
  name: 'blacklistDetail',
  data() {
    return {
      blocks: [
        {
          name: '黑名单列表',
          urlTo: '/blacklistDetail/blacklist'
        }, {
          name: '统计分析',
          urlTo: '/blacklistDetail/analysis'
        }
      ],
      curIndex: 0
    }
  },
  methods: {
    jump(index, val) {
      this.curIndex = index
      this.$router.push({path: val.urlTo})
    }
  },
  mounted() {
    this.curIndex = this.blocks.findIndex(item => { return item.urlTo === this.$route.path })
  }
}
</script>
<style lang="scss" scoped>

$color999: #999;
$color666: #666;
$color333: #333;
.blacklistDetail {
    -webkit-box-pack: justify;
    -webkit-justify-content: space-between;
    -ms-flex-pack: justify;
    justify-content: space-between;
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    font-size: 14px;
    margin-top: 20px;

  & /deep/ .loading {
    position: fixed;
    left: 0;
  }

  & /deep/ .full {
    width: 100%;
  }

  .mgt-20 {
    margin-top: 20px;
  }
  .mgl-50 {
    margin-left: 50px;
  }

  .mgt-b {
    margin: 40px 0 50px 0;
  }

  .color-999 {
    color: $color999;
  }
  .color-risk-h {
    color: red;
  }
  .color-risk-m {
    color: orange;
  }
  .color-risk-l {
    color: #f6dda4;
  }
  .color-risk-no {
    color: $color999;
  }

  .white-wrap {
    padding: 20px;
    background-color: #fff;
    border-radius: 5px;
    box-shadow: 0 2px 8px #e2d7d7;
  }

  .left-main {
    flex: 0 0 212px;
    margin-right: 20px;

    .anchor {
      display: block;
      cursor: pointer;
      span {
        display: block;
      }
    }
  }

  .right-main {
    flex: 1;
  }

  .anchor {
    font-family: MicrosoftYaHei-Bold;
    font-size: 16px;
    border-left: none;
    font-weight: 700;
    line-height: 17px;
    line-height: 50px;
    padding-left: 10px;
    color: #555;
    &.active {
      color: #2f82ef;
    }
  }
}

</style>



// WEBPACK FOOTER //
// src/view/blacklist/index.vue